package com.dxq.test.db;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;
import java.util.List;

/**
 * Author: zsh
 * Date: 2023/10/17
 * Describe: 防治表（字段）
 */
@DatabaseTable(tableName = "Vaccine")
public class Vaccine implements Serializable {

    public final static String ID_FIELD_NAME = "vaccine_id";

    // id = true:表明这个字段是这条记录的唯一标志符, generatedId = true:表明自动增加的ID
    //序号
    @DatabaseField(generatedId = true, columnName = ID_FIELD_NAME)
    private int vaccine_id;

    //编号
    @DatabaseField(columnName = "code")
    private String code;

    //类型
    @DatabaseField(columnName = "type")
    private String type;

    //药品名称
    @DatabaseField(columnName = "name")
    private String name;

    //备注
    @DatabaseField(columnName = "remark")
    private String remark;

    //防治时间
    @DatabaseField(columnName = "time")
    private String time;

    //下次防治时间
    @DatabaseField(columnName = "next_time")
    private String next_time;

    //是否开启(下次防治)滚动提醒
    @DatabaseField(columnName = "next_time_remind")
    private boolean next_time_remind;

    //所属牧场  牧场--外键
    @DatabaseField(columnName = "pasture_id", foreign = true, foreignAutoRefresh = true, foreignAutoCreate = true)
    private Pasture pasture_id;//序号

    //防治对应的牲畜信息
    @DatabaseField(persisted = false)//如果设置为false，表示这个字段不会写到数据库中
    private Label label;

    //防治对应的分群信息
    @DatabaseField(persisted = false)//如果设置为false，表示这个字段不会写到数据库中
    private Group group;

    public Vaccine() {
    }

    public Vaccine(String code, String type, String name, String remark, String time, String next_time, boolean next_time_remind, Pasture pasture_id) {
        this.code = code;
        this.type = type;
        this.name = name;
        this.remark = remark;
        this.time = time;
        this.next_time = next_time;
        this.next_time_remind = next_time_remind;
        this.pasture_id = pasture_id;
    }

    public int getVaccine_id() {
        return vaccine_id;
    }

    public void setVaccine_id(int vaccine_id) {
        this.vaccine_id = vaccine_id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getNext_time() {
        return next_time;
    }

    public void setNext_time(String next_time) {
        this.next_time = next_time;
    }

    public boolean isNext_time_remind() {
        return next_time_remind;
    }

    public void setNext_time_remind(boolean next_time_remind) {
        this.next_time_remind = next_time_remind;
    }

    public Pasture getPasture_id() {
        return pasture_id;
    }

    public void setPasture_id(Pasture pasture_id) {
        this.pasture_id = pasture_id;
    }

    public Label getLabel() {
        return label;
    }

    public Group getGroup() {
        return group;
    }

    public void setGroup(Group group) {
        this.group = group;
    }

    public void setLabel(Label label) {
        this.label = label;
    }

    @Override
    public String toString() {
        return "Vaccine{" +
                "vaccine_id=" + vaccine_id +
                ", code='" + code + '\'' +
                ", type='" + type + '\'' +
                ", name='" + name + '\'' +
                ", remark='" + remark + '\'' +
                ", time='" + time + '\'' +
                ", next_time='" + next_time + '\'' +
                '}';
    }
}
